#include "OurKickOffBehaviour.h"
#include "../CommonFunctions.h"

extern CEvaluatingPlayerList* ePlayerList;

/*
 * 
 * nase zahravanie
 * <Vykopavanie> - pociatocne zahravanie zo stredu ihriska (Kick-off) alebo ak dostaneme gol 
 *
 * (povodne existovalo toto spravanie ako telo if-bloku, metoda BehaveWithBall, trieda PlayerTactics)
 */
void OurKickOffBehaviour::Behave()
{
	CEvaluatingPlayer* pEvPlayer = ePlayerList->GetKickOffPlayer();
	if(pEvPlayer != NULL)
	{
		Point playerPosition((float)pEvPlayer->GetPlayerXPosition(), (float)pEvPlayer->GetPlayerYPosition());
		printf("Rozohravam hracovi c.%d na poziciu [%lf, %lf]\n", pEvPlayer->GetPlayerIDNumber(), pEvPlayer->GetPlayerXPosition(), pEvPlayer->GetPlayerYPosition());
		GetPassBallToBehaviour()->Behave(playerPosition, 1);
		return;
	}
	else
	{
		GetPassBallToBehaviour()->Behave(Point(-25, 0), 0.7f);
		return;
	}
}
